#! /bin/bash
function make_input_file()
{
    in_file_num=`ls ./data/`
    if [ -z "$in_file_num"];then
        mkdir ./data
    fi
    in_file_num=`ls ./data/`
    i=1
    if $in_file_num
    then
        echo "data文件夹空,建立$1个in空白in文件"
        while ((`expr $1` >= $i)) 
        do
            > ./data/"${i}.in"
            echo ${i}
            let "i++"
        done
    else
    echo "data文件夹非空"
    fi
}


ls_file_num=`ls`
for i in $ls_file_num; do
    if [ "$i" == "input_file.sh" ];then
        echo "跳过.sh文件"
    else
        echo $i
        cd ./${i:0:-1}
        echo "当前路径为"
        pwd
        make_input_file 5
        cd ../
    fi
done
read